<% if mobile? %>

<% content_for :app_back do%>
<a href="javascript:void(0)" onclick="history.go(-1)">
  <i class="icon-arrow-left"></i>
</a>
<% end %>


<% content_for :app_title do %>
  设计师活动
<% end %>
<% content_for :app_action do %>
<a href=""></a>
<% end %>

<div class="design-promotions-index-mobile">
  <div class="list">
    <% @promotions.each do |promotion| %>
      <a href="<%= design_promotion_path(promotion) %>" class="item">
        <img src="<%= promotion.main_img %>" alt="<%= promotion.title %>">
        <h1><%= promotion.title %></h1>
      </a>
    <% end %>
  </div>
</div>
<% else %>

<% breadcrumb :design_promotions %>

<section class="designers-activities">
    <div class="row">
        <% @promotions.each do |promotion| %>
          <div class="col-xs-6 item">
              <a href="<%= design_promotion_path(promotion) %>"><img src="<%= promotion.main_img %>" alt="<%= promotion.title %>"></a>
              <div class="info">
                  <a href="<%= design_promotion_path(promotion) %>">
                      <h1><%= promotion.title %></h1>
                  </a>
                  <p><%= strip_tags(promotion.content).truncate(200) %></p>
                  <div class="time"><%= promotion.publish_time.to_s(:db) %></div>
              </div>
              <!--
              <div class="state start">
                  报名中
                  <div class="triangle"></div>
              </div>
              -->
          </div>
        <% end %>

    </div>

    <% if @promotions.total_pages > 1 %>
    <div class="row text-center load-more">
      <%= common_paginate(@promotions) %>
    </div>
    <% end %>
</section>

<% end %>
